﻿using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using WoltersKluwer.SPChainGang.Core.Util;

namespace WoltersKluwer.SPChainGang.Core.Data.Entity
{
    public class ReportFileRecord : ReportRecord
    {
        public ReportFileRecord()
            : base(null)
        {
        }

        public ReportFileRecord(SPListItem item)
            : base(item)
        {
        }

        public string CurrentFile { get; set; }

        public override void Update()
        {
            var originPage = SPEncode.UrlEncodeAsUrl(OriginPage);
            CSVReportHelper.AppendRow(CurrentFile, originPage, DetectedLink, ReplacedWith, AdditionalInfo);
        }
    }
}
